ALTER
SET

Syntax: ALTER 'variable' TO value
   and: SET [#] variable TO value
Location: ALTER (DIY Toolkit - Vol U)

These commands allow you to set up universal constants which can be read from within any program.

The constants to be set up appear as variable in the command.  They can be string, floating point or integer but must not have previously been used in the program.  For SET, they must NOT appear in quotes.

Once set, you can use ALTER to change the value of the constants.

As an added bonus, if the variable is prefixed by a hash sign, then this is taken to a pointer to a system variable, which will always point to that system variable even if the system variables move.  For example to read the Network number, you could use:

SET #NET_ID TO HEX('37')
PRINT PEEK (NET_ID)

The command ALTER allows you to re-define the universal constants created with SET.

The constant to be re-defined must appear in quotes as the first parameter.  As with SET, the variable and value must be of the same type, otherwise an error will be reported.

If the constant has not previously been defined with SET, then if it is recognised for some other reason an 'In Use' error will be reported.

Example:
ALTER 'DEF_DRIVE$' TO 'win1_prog_'

CROSS-REFERENCE:
See ALIAS.
